﻿import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick3D 1.15
import QtQuick3D.Helpers 1.15

Window {
    id: window
    width: 640
    height: 480
    visible: true

    View3D {
        id: view
        anchors.fill: parent
        environment: SceneEnvironment {
            clearColor: "#3a4055"
            backgroundMode: SceneEnvironment.Color
        }
        Node {
            id: scene
            PerspectiveCamera {
                id: camera
                z: 2000
            }
            DirectionalLight {
                z: 3000
                brightness: 300
            }
            Boat {
                PropertyAnimation on eulerRotation.x {
                    loops: Animation.Infinite
                    duration: 10000
                    to: 360
                    from: 0
                }
                PropertyAnimation on eulerRotation.y {
                    loops: Animation.Infinite
                    duration: 10000
                    to: 360
                    from: 0
                }
            }
        }

        DebugView {
            source: view
        }
        AxisHelper {
            scale: Qt.vector3d(10, 10, 10)
            enableAxisLines: true
            enableXYGrid: true
            enableXZGrid: false
            enableYZGrid: false
        }
        WasdController {
            controlledObject: scene
        }
    } // view 3d
}
